import 'package:dart_bean/field_info.dart';
import 'package:dart_bean/flow/unsupported_map_generic_checker.dart';
import 'package:dart_bean/flow/unsupported_type_alise_checker.dart';
import 'package:dart_bean/util/field_feature.dart';

class CodeFlowFeature extends FieldFeature {
  final Set<FieldFeature> _flows = {};

  CodeFlowFeature() {
    _flows.add(UnsupportedTypeAliseChecker.it);
    _flows.add(UnsupportedMapGenericChecker.it);
  }

  @override
  String? getConvert(FieldInfo field) {
    for (var f in _flows) {
      f.getConvert(field);
    }
    return null;
  }

  @override
  String? mergeToJsonRightValue(FieldInfo field, String instance, String type) {
    for (var f in _flows) {
      f.mergeToJsonRightValue(field, instance, type);
    }
    return null;
  }
}
